<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <base href="http://hefengxian.github.io/">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Ubuntu 下安装MySQL</title>

    <link rel="shortcut icon" href="assets/site/images/favicon.ico" />

    <link rel="stylesheet" href="http://cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/site/css/site.css">

    <script src="assets/libs/art-template/template.js"></script>
    <script src="http://cdn.bootcss.com/require.js/2.1.20/require.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="assets/libs/require-js/main-cdn.js"></script>
    <script src="assets/site/js/site.js"></script>
</head>
<body>
<div class="container">
    <div id="_navbar"></div>


    <div id="_content">
        <br>
        <h3 class="header">
            <i class="fa fa-linux"></i>&nbsp;
            Ubuntu 下安装MySQL
            <small>--</small>
        </h3>

        <!-- 文章信息 -->
        <p class="info">
            <!-- 日期 -->
            <span class="date"><i class="fa fa-calendar"></i>2015-11-21</span>
            <!-- 分类 -->
            <span class="category"><i class="fa fa-folder"></i><a href="#">Linux</a></span>
            <!-- 作者 -->
            <span class="author"><i class="fa fa-user"></i><a href="#">HFX</a></span>
        </p>
        <hr>

        <!-- 正文 -->
        <div class="text">
            <p>1. 打开终端，输入如下命令：</p>
            <pre><code class="bash">$ sudo apt-get install mysql-server-5.6 mysql-client-5.6</code></pre>
            <p>安装过程会让你输入MySQL root用户的密码，按照提示输入两遍你想要的密码即可</p>
            <p>2. 验证安装是否成功，在终端输入如下命令：</p>
            <pre><code class="bash">$ mysql --version
mysql  Ver 14.14 Distrib 5.6.19, for debian-linux-gnu (x86_64) using  EditLine wrapper</code></pre>

            <p>3. 如果想同MySQL Workbench一起安装而使用如下命令：</p>
            <pre><code class="bash">$ sudo apt-get install mysql-server-5.6 mysql-client-5.6 mysql-workbench</code></pre>
            <p>可能得到结果是缺少依赖，迫使你安装低版本的MySQL，如果遇到这种情况，建议百度/Google 'MySQL Workbench' 去官网下载对应系统的最新版本的软件，而对于Ubuntu来说是有打包好的.deb包下载的，下载回来双击即可自动安装</p>

            <img class="img-responsive img-rounded" src="assets/site/images/mysql_workbench.png">
        </div>
    </div>


    <div id="_footer"></div>
</div>


</body>
<script>
    $(document).ready(function () {
        /*代码高亮*/
        require(['hljs'], function () {
            $('pre code').each(function (i, block) {
                hljs.highlightBlock(block);
            });
        });
    });
</script>

</html>